<template>
  <div class="mySwiper">
    <swiper
      class="swiper"
      :options="swiperOption"
    >
      <swiper-slide class="text">
        <div
          class="nav_news_list"
          v-for="item in newsList"
          :key="item.id"
        >
          <div class="nav_news_id"></div>
          <div class="nav_news_item">
            {{item.name}}
          </div>
          <div
            v-show="item.sta==1"
            class="my_new"
          >[ 新 ]</div>
        </div>
      </swiper-slide>
      <div
        class="swiper-scrollbar"
        slot="scrollbar"
      ></div>
    </swiper>
  </div>
</template>

<script>
import { Swiper, SwiperSlide, directive } from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";
export default {
  name: "mySwiper.vue",
  props: {
    lef: {
      type: String
    },
    rig: {
      type: String
    },
    num: {
      type: Number,
      default: 3
    },
    pag: {
      type: Boolean,
      default: false
    },
    urlList: {
      type: Array
    },
    bor: {
      type: Number
    }
  },
  components: {
    Swiper,
    SwiperSlide
  },

  data() {
    return {
      newsList: [
        {
          name: "关于信阳市中心城区公交13路线路临时绕行公告",
          id: 0,
          sta: 1
        },
        {
          name: "关于信阳市中心城区公交8路和9路线路临时绕行公告",
          id: 1,
          sta: 2
        },
        {
          name: "中心城区恢复3条公交线路运营",
          id: 2,
          sta: 1
        },
        {
          name: "信阳定制公交服务介绍",
          id: 3,
          sta: 2
        },
        {
          name: "复工通勤不用愁，定制公交来接您",
          id: 4,
          sta: 2
        },
        {
          name: "市交通运输局党组书记、局长朱时锋莅临公司检查指站指挥...",
          id: 5,
          sta: 1
        },
        {
          name: "防疫期间信阳市公共交通总公司开通定制公交服务",
          id: 6,
          sta: 2
        },
        {
          name: "公交志愿服务队为市民运送生活物资",
          id: 7,
          sta: 1
        },
        {
          name: "公交志愿服务队为市民运送生活物资",
          id: 8,
          sta: 1
        },
        {
          name: "公交志愿服务队为市民运送生活物资",
          id: 9,
          sta: 1
        }
      ],
      swiperOption: {
        direction: "vertical",
        slidesPerView: "auto",
        freeMode: true,
        scrollbar: {
          el: ".swiper-scrollbar"
        },
        mousewheel: true
      }
    };
  },

  methods: {
    a() {}
  }
};
</script>

<style lang='scss' scoped>
.swiper-container {
  height: 100%;
  width: 100%;
}
.mySwiper {
  height: 365px;
}
.nav_news_list {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  // margin-right: 72px;
  .nav_news_item {
    cursor: pointer;
    color: #333333;
    font-size: 16px;
    max-width: 365px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .my_new {
    color: #e6142f;
    font-size: 16px;
    margin-left: 26px;
    white-space: nowrap;
  }
  .nav_news_id {
    width: 8px;
    height: 8px;
    background: rgba(28, 137, 224, 1);
    border-radius: 50%;
    margin-right: 21px;
  }
}
// .sw_foot ::v-deep .swiper-pagination-bullet {
//   margin-right: 15px;
//   background: rgba(148, 148, 148, 1);
// }
// .sw_foot ::v-deep .swiper-pagination-bullet-active {
//   background-color: #ffffff;
// }
</style>
